<template>
  <div class="left-container">
    <h3>Left 组件</h3>
    <hr />
<h4> num数据{{num}}</h4>
    <!-- <p>count 值：{{ $store.state.count }}</p> -->
     <p>count 值：{{ count }} {{name}}</p>
    <button @click="btn" class="btn btn-primary">+1</button>
        <!-- <button @click="$store.commit('cont/test')" class="btn btn-primary">+1</button> -->
         <button @click="test" class="btn btn-primary">test数据</button>
  </div>
</template>

<script>
import {mapState,mapMutations} from "vuex"
export default {
  name: "Left",
  computed:{
    ...mapState(["count" , "name"]),
    ...mapState('cont',['num'])
  },methods:{
    btn(){
      this.$store.commit('add', {num:10,name:'我去'})
    },
    ...mapMutations('cont',['test'])
  }
};
</script>

<style>
</style>
